package com.kiell.gulimall.product.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Description:
 * @Created: with IntelliJ IDEA.
 * @author: kiell
 * @createTime: 2024年3月1日16:54:41
 **/

@Configuration
//@EnableCaching
public class RedissonConfig {

    @Bean
    public RedissonClient redissonClient(){
        Config config = new Config();
        //设置单节点模式，设置redis地址。ssl安全连接redission://192.168.56.102:6379
        //redis://192.168.80.31:6379
        //redis://redis.gulimall:6379
        config.useSingleServer().setAddress("redis://redis.gulimall:6379");
        RedissonClient redisson = Redisson.create(config);
        return redisson;
    }
}


